using System.IO;

namespace CLASS_
{
    public class Word_Manager
    {
        private string word_;
        public List<char> word_list = new List<char>(0);
        public void init_word()
        {
            foreach (dynamic i in word_)
            {
                word_list.Add(i);
            }
        }

        public Word_Manager()
        {
            init_word();

        }

        public Word_Manager(string word)
        {
            this.word_ = word;
        }

        ~Word_Manager()
        {
            Console.WriteLine("The Destructor works");
        }

        // 
        public Dictionary<char, int> check_right(string input, string right)
        {
            // 计算长度并初始化返回结果
            Dictionary<char, int> res = new Dictionary<char, int>();
            int n = right.Length;
            int m = input.Length;

            // 检查长度是否相等
            if (n != m) return res;

            // 检查是否为字母，首先转为小写
            char[] new_input = new char[m];
            for (int i = 0; i < input.Length; i++)
            {
                if (input[i] <= 'Z' && input[i] >= 'A')
                {
                    new_input[i] = (char)((int)input[i] + 32);
                }
                else
                {
                    new_input[i] = input[i];
                }
                // 真牛逼的字符检查
            }

            foreach (dynamic i in new_input)
            {
                if (i <= 'z' && i >= 'a')
                {
                    continue;
                }
                else
                {
                    return res;
                }
            }

            // 检查每个字符,没有那么简单
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    // 这个检查真的很巧妙啊
                    if (i == j && new_input[i] == right[j])
                    {
                        res.Add(new_input[i], 0);
                    }

                    // 
                }
            }
        }
    }
}